﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Globalization;


    class Program
    {
        static void Main(string[] args)
        {
            string text = @"I was born at 14.06.1980. My sister was born at 3.7.1984. 
                            In 5/1999 I graduated my high school. The law says (see section 7.3.12) that we are allowed 
                            to do this (section 7.4.2.9).";
            string[] textArr = text.Split(' ');
            for (int i = 0; i < textArr.Length; i++)
            {
                if (Regex.IsMatch(textArr[i], @"[\d.]{1,31}[.]{1}[\d.]{1,12}[.]{1}[\d]{4}"))
                {
                    string validDate = textArr[i].Trim('.');
                    Console.WriteLine(validDate);
                    DateTime date = DateTime.ParseExact(validDate, "d.M.yyyy", CultureInfo.InvariantCulture);
                    Console.WriteLine(date.ToString(CultureInfo.GetCultureInfo("en-CA")));
                }
            }
            {
                
            }
        }
    }

